#ifndef _TList_h_
#define _TList_h_
#include <stddef.h>
#include "TNode.h"
//---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------
class TListE {

    private :

      typedef void (*TFunctionAction)(TNode*, void* reference = NULL);
      typedef bool (*TFunctionConditional)(TNode*, void*  reference = NULL);
      TNode* PosNode(int);

    protected:

      int   length;
      TNode *first;

    public :

      TListE();
      TListE(void*);
      TListE(TListE *);
      ~TListE();
      void  Add(void*);
      void  Delete(int);
      void  Delete(void*);
      void  Insert(void*, int);
      void* Transfer(int);
      bool  Update(void*, int);
      int   Length(){return length;}
      void* Get(int);
      void  ForEach(TFunctionAction, void*);
      void* FirstSatisfy(TFunctionConditional, void*);
      void  AllThatSatisfy(TFunctionConditional, TListE&, void*);
      int   HowManySatisfy(TFunctionConditional, void*);
      void  OrderList(TFunctionConditional, void*);
      bool  Empty(){return !length;};
      TListE operator=(const TListE &ListT) {length = ListT.length; first = ListT.first; return *this;};
};
//---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------
#endif
 